package cn.wen233.srpc.api.back;

import cn.wen233.srpc.api.HelloService;
import cn.wen233.srpc.basic.rollback.RollbackFactory;

/**
 * HelloService 熔断处理机制
 *
 * @author wenei
 * @date 2021-10-31 18:34
 */
public class HelloServiceRollbackFactory implements RollbackFactory<HelloService> {
    @Override
    public HelloService create(Throwable throwable) {
        HelloService rollbackService = new HelloService() {
            @Override
            public Integer hello(int x) {
                return -999;
            }
        };
        return rollbackService;
    }
}
